package com.example.templateapp.ui.broadtest

import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.templateapp.R
import com.example.templateapp.receiver.LogoutReceiver
import kotlinx.android.synthetic.main.activity_broadcast_receiver_test.*

class BroadcastReceiverTestActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_broadcast_receiver_test)


        button.setOnClickListener {
            sendBroadcast(Intent("com.daydream.receiver.LogoutReceiver"))
        }


        registerReceiver(LogoutReceiver(), IntentFilter("com.daydream.receiver.LogoutReceiver"))
    }
}